import { ApiProperty } from '@nestjs/swagger';
import { CreateDateColumn, UpdateDateColumn, Column } from 'typeorm';

export abstract class BaseEntity {
  @Column({
    type: 'varchar',
    nullable: true,
    default: '',
    length: 64,
    comment: '创建者',
  })
  create_by: string;

  @CreateDateColumn({
    type: 'datetime',
    nullable: true,
    comment: '创建时间',
  })
  @ApiProperty()
  create_time: Date;

  @Column({
    type: 'varchar',
    nullable: true,
    default: '',
    length: 64,
    comment: '更新者',
  })
  update_by: string;

  @UpdateDateColumn({
    type: 'datetime',
    nullable: true,
    comment: '更新时间',
  })
  @ApiProperty()
  update_time: Date;

  @Column({
    type: 'varchar',
    nullable: true,
    length: 500,
    comment: '备注',
  })
  remark: string;
}
